<?php

//链接数据库
	$data = new mysqli('127.0.0.1','root','','friday');
    $phone = $_POST['phone']; 
	$psw = $_POST['pas'];
	//设置中文
	mysqli_query($data,"SET NAMES utf8");
	
	$sqll = 'select * from zhanghao where phone= '.$phone;
	if($query = mysqli_query($data, $sqll)){
		$rowcount = mysqli_num_rows($query);
		if($rowcount>0){
//			echo '此号已被注册';
			$sql="update zhanghao set pas='{$psw}' where phone='{$phone}'";
			if($data->query($sql)===TRUE){
				echo "密码修改成功";
			}else{
				echo "密码修改失败".$data->error;
			}
		
		}else{
    			echo "此账号未注册";

	};
	};
	
		
  
	mysqli_close($data);
?>